package com.iwunu.gateway.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.iwunu.gateway.entity.OrgUser;

import io.lettuce.core.dynamic.annotation.Param;

/**
 * @author kinfeng
 * @date 2021/3/18 10:00 AM
 * @desc
 */
@Repository
public interface OrgUserRepository extends JpaRepository<OrgUser, Long> , JpaSpecificationExecutor<OrgUser> {
	
	   @Query(value="select i from OrgUser i where i.phone=:phone and i.password=:password")
	   OrgUser findOrgUser(@Param("phone") String phone,@Param("password") String password);
	    
	   @Query(value="select i from OrgUser i where i.userId=:userId ")
	   OrgUser findOrgUserByUserId(@Param("userId") String userId);
}
